ComboRow

A [class@Gtk.ListBoxRow] used to choose from a list of items.

<picture> <source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="combo-row.png" alt="combo-row"> </picture>

The AdwComboRow widget allows the user to choose from a list of valid choices. The row displays the selected choice. When activated, the row displays a popover which allows the user to make a new choice.

AdwComboRow mirrors [class@Gtk.DropDown], see that widget for details.

AdwComboRow is [property@Gtk.ListBoxRow:activatable] if a model is set.

CSS nodes

AdwComboRow has a main CSS node with name row and the .combo style class.

Its popover has the node named popover with the .menu style class, it contains a [class@Gtk.ScrolledWindow], which in turn contains a [class@Gtk.ListView], both are accessible via their regular nodes.

Accessibility

AdwComboRow uses the GTK_ACCESSIBLE_ROLE_COMBO_BOX role.

Constructors

this
this(AdwComboRow* adwComboRow, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new AdwComboRow.

Members

Functions

getComboRowStruct
AdwComboRow* getComboRowStruct(bool transferOwnership)

Get the main Gtk struct

getExpression
Expression getExpression()

Gets the expression used to obtain strings from items.

getFactory
ListItemFactory getFactory()

Gets the factory that's currently used to populate list items.

getListFactory
ListItemFactory getListFactory()

Gets the factory that's currently used to populate list items in the popup.

getModel
ListModelIF getModel()

Gets the model that provides the displayed items.

getSelected
uint getSelected()

Gets the position of the selected item.

getSelectedItem
ObjectG getSelectedItem()

Gets the selected item.

getStruct
void* getStruct()

the main Gtk struct as a void*

getUseSubtitle
bool getUseSubtitle()

Gets whether to use the current value as the subtitle.

setExpression
void setExpression(Expression expression)

Sets the expression used to obtain strings from items.

setFactory
void setFactory(ListItemFactory factory)

Sets the GtkListItemFactory to use for populating list items.

setListFactory
void setListFactory(ListItemFactory factory)

Sets the GtkListItemFactory to use for populating list items in the popup.

setModel
void setModel(ListModelIF model)

Sets the [iface@Gio.ListModel] to use.

setSelected
void setSelected(uint position)

Selects the item at the given position.

setUseSubtitle
void setUseSubtitle(bool useSubtitle)

Sets whether to use the current value as the subtitle.

Static functions

getType
GType getType()

Variables

adwComboRow
AdwComboRow* adwComboRow;

the main Gtk struct

Inherited Members

From ActionRow

adwActionRow
AdwActionRow* adwActionRow;

the main Gtk struct

getActionRowStruct
AdwActionRow* getActionRowStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

activate
bool activate()

Activates @self.

getType
GType getType()
addPrefix
void addPrefix(Widget widget)

Adds a prefix widget to @self.

addSuffix
void addSuffix(Widget widget)

Adds a suffix widget to @self.

getActivatableWidget
Widget getActivatableWidget()

Gets the widget activated when @self is activated.

getIconName
string getIconName()

Gets the icon name for @self.

getSubtitle
string getSubtitle()

Gets the subtitle for @self.

getSubtitleLines
int getSubtitleLines()

Gets the number of lines at the end of which the subtitle label will be ellipsized.

getTitleLines
int getTitleLines()

Gets the number of lines at the end of which the title label will be ellipsized.

remove
void remove(Widget widget)

Removes a child from @self.

setActivatableWidget
void setActivatableWidget(Widget widget)

Sets the widget to activate when @self is activated.

setIconName
void setIconName(string iconName)

Sets the icon name for @self.

setSubtitle
void setSubtitle(string subtitle)

Sets the subtitle for @self.

setSubtitleLines
void setSubtitleLines(int subtitleLines)

Sets the number of lines at the end of which the subtitle label will be ellipsized.

setTitleLines
void setTitleLines(int titleLines)

Sets the number of lines at the end of which the title label will be ellipsized.

addOnActivated
gulong addOnActivated(void delegate(ActionRow) dlg, ConnectFlags connectFlags)

This signal is emitted after the row has been activated.

Meta